package com.metagurukul.informer.service;

import java.util.List;
import junit.framework.TestCase;

import com.metagurukul.informer.service.QuestionsService;
import com.metagurukul.informer.valueObjects.Questions;

public class QuestionServiceTest extends TestCase{
	

	int question_id;
	public void testGetQuestions() {
		try{
			QuestionsService questionsService = new QuestionsService();
			List<Questions> list=questionsService.getQuestions();
		} catch (Exception ex) {
			assertNull(ex);
		}	
	}
	public void testInsert(){
		
	try{
			QuestionsService questionsService = new QuestionsService();
			question_id = questionsService.insert("Test Question", "Test Question description", "C", "aman.agrawal@metagurukul.com");
			assertEquals(false,question_id==0);
		} catch (Exception ex) {
			assertNull(ex);
		}
	}
	 public void testDelete(){
		 try{

			 	QuestionsService questionsService = new QuestionsService();
				boolean flag = questionsService.deleteQuestion(question_id);
				assertEquals(false,flag);
			 
		 } catch (Exception ex) {
				assertNull(ex);
			}
	 }
	
	

}
